package com.tyylab.kestrel.framework.example.web.consumer;


import com.tyylab.kestrel.framework.example.api.IHellowWorldApi;
import com.tyylab.kestrel.framework.spring.rpc.feign.annotation.EnableKestrelFeignClient;

import com.tyylab.kestrel.framework.util.ContextUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;

// @SpringBootApplication
// @EnableKestrelFeignClient(serviceName = "tyylab-provider",apiBasePackages = {"com.tyylab.kestrel.framework.example.api"})
// @EnableKestrelFeignClient(serviceName = "user-service2",apiBasePackages = {"com.tyylab.kestrel.framework.example.web.consumer"})
//@EnableFeignClients
public class App implements CommandLineRunner
{
    public static void main(String[] args) {
        SpringApplication.run(App.class, args);
    }

    @Autowired
    IHellowWorldApi hellowWorldApi;
    @Override
    public void run(String... args) throws Exception {
        ContextUtil.setTenantId("tyy");
        System.out.println(hellowWorldApi.sayHi("tyy", 20));
        System.out.println(hellowWorldApi.sayHi2("tyy23", 230));
        System.out.println(hellowWorldApi.sayHi("tyysaa", 20));
        System.out.println(hellowWorldApi.sayHi2("tywqy", 2000));
    }
}
